<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>16.开发BOOTSTRAP栅格系统这么简单</title>
    <style>
      .container {
        width: 1020px;
        margin: 0 auto;
      }

      [class^='col-'] {
        background-color: blueviolet;
        background-clip: content-box;
        box-sizing: border-box;
        padding: 10px;
        border: solid 2px #ddd;
        color: white;
      }

      .row {
        display: grid;
        grid-template-rows: repeat(12, 1fr);
        grid-template-columns: repeat(12, 1fr);
        gap: 10px;
      }

      .col-1 {
        grid-column-end: span 1;
      }

      .col-2 {
        /* grid-column-end: span 2; */
        grid-column: span 2;
      }

      .col-3 {
        grid-column-end: span 3;
      }

      .col-4 {
        grid-column-end: span 4;
      }

      .col-5 {
        grid-column-end: span 5;
      }
      .col-6 {
        grid-column-end: span 6;
      }
      .col-7 {
        grid-column-end: span 7;
      }
      .col-8 {
        /* grid-column-end: span 8; */
        grid-column: span 8;
      }
    </style>
  </head>

  <body>
    <article class="container">
      <div class="row">
        <div class="col-2">1</div>
        <div class="col-8">2</div>
        <div class="col-2">3</div>
      </div>
    </article>
  </body>
</html>
